<?php echo $this->anchor('Create new', array('action'=>'add'), array('class'=>'button button_add')); ?>
<?php if($this->paginator->getCurrentItemCount()): ?>
    <table class="datagrid" cellpadding="0" cellspacing="0">
        <thead>
            <tr>
                <th>&nbsp;</th>
                <th><?php echo $this->translate('Name') ?></th>
                <th><?php echo $this->translate('Type') ?></th>
                <th><?php echo $this->translate('Status') ?></th>
                <th><?php echo $this->translate('Created') ?></th>
                <th>&nbsp;</th>
            </tr>
        </thead>
        <tbody>
            <?php foreach($this->paginator->getCurrentItems() as $item): ?>
            <?php $person = new Model_Person($item); ?>
            <tr class="<?php echo $this->cycle(array('odd', 'even'))->next() ?>">
                <td>#<?php echo $person->getId(); ?></td>
                <td><?php echo $person->getFirstName(); ?></td>
                <td><?php echo $person->getType(); ?></td>
                <td><?php echo $person->getStatus(); ?></td>
                <td><?php echo $person->getCreated(); ?></td>
                <td>
                    <?php echo $this->anchor('Edit', array('action'=>'edit', 'id'=>$person->getId()), array('class'=>'button button_edit')); ?>
                    <?php echo $this->anchor('Delete', array('action'=>'delete', 'id'=>$person->getId()), array('class'=>'button button_delete')); ?>
                    <?php echo $this->anchor('Create an user account for this person', array('action'=>'add', 'controller'=>'user', 'personId'=>$person->getId()), array('class'=>'button button_userAdd')); ?>
                </td>
            </tr>
            <?php endforeach; ?>
        </tbody>
    </table>
<?php
    echo $this->paginator->render();
else:
    echo '<p>' . $this->translate('There is no people to show') . '</p>';
endif;